﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AnalyticsGadget.Models
{
    public class Report
    {
        public Report()
        {
            CurrentTimespan = Timespan.Day;
        }

        public string Name { get; set; }

        public Timespan CurrentTimespan { get; set; }

        public string CurrentProfileID { get; set; }

        public List<ReportData> DataItems { get; set; }

        public int Total
        {
            get 
            {
                return DataItems.Sum(di => di.Value);
            }
        }

        public int MinValue
        {
            get
            {
                return DataItems.Min(di => di.Value);
            }
        }

        public int MaxValue
        {
            get
            {
                return DataItems.Max(di => di.Value);
            }
        }
    }
}
